Skip to content

CoreGraphics: Use single-buffering#343

Open
madsmtm wants to merge 6 commits intomasterfrom
apple-buffering
Open

CoreGraphics: Use single-buffering#343
madsmtm wants to merge 6 commits intomasterfrom
apple-buffering

Conversation

@madsmtm
Copy link
Member

@madsmtm madsmtm commented Mar 5, 2026

We currently create a new Vec each time next_buffer is called on macOS/iOS, which is inefficient, we should instead re-use the previous buffer.

Tested on:

  • macOS 15.7.3 M2
  • macOS 10.12.6 Intel
  • iOS simulator

Should help with #83.
Extracted from #329 (since that one may be more difficult to land).

@madsmtm madsmtm added enhancement New feature or request DS - CoreGraphics macOS/iOS/tvOS/watchOS/visionOS backend labels Mar 5, 2026
@madsmtm madsmtm added this to the Softbuffer v0.5 milestone Mar 5, 2026
@madsmtm madsmtm changed the title CoreGraphics: Use double-buffering CoreGraphics: Use single-buffering Mar 18, 2026
Allows us to get by with a single buffer, since it properly signals us
when the buffer is and isn't in use.
@madsmtm
Copy link
Member Author

madsmtm commented Mar 18, 2026

I found a way to get a reliable signal from CG for when QuartzCore is reading from the buffer (CGDataProvider::new_direct), so I've updated the PR to use that (which, incidentally, also means we only need a single buffer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - CoreGraphics macOS/iOS/tvOS/watchOS/visionOS backend enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

2 participants